class _const:
    class ConstError(TypeError):
        pass

    class ConstCaseError(ConstError):
        pass

    def __setattr__(self, name, value):
        if name in self.__dict__:
            raise self.ConstError("Can't change const $s ." % name)
        if not name.isupper():
            raise self.ConstCaseError("const %s name is not all uppercase" % name)
        self.__dict__[name] = value



